# -*- coding: utf-8 -*-
from appium import webdriver
import unittest, time
from PO.SearchPage import SearchPage
from PO.IndexPage import IndexPage

class TestSearch(unittest.TestCase):

    def setUp(self):
        capabilities = {
            'platformName': 'Android',
            'platformVersion': '4.4.2',
            'deviceName': '127.0.0.1:62001',
            'appPackage': 'com.guokr.mentor',
            'appActivity': '.ui.activity.MainActivity',
            'unicodeKeyboard': True,
            'resetKeyboard': True,
            'noReset': True
        }
        self.driver = webdriver.Remote("http://localhost:4723/wd/hub", capabilities)
        self.myindex = IndexPage(self.driver)
        self.searchPage = SearchPage(self.driver)

    def tearDown(self):
        self.driver.quit()

    def test05(self):
        """点击搜索框进入热门搜索"""
        self.myindex.search()
        self.assertEqual(self.searchPage.hot(), "热门搜索")

    def test06(self):
        """选择保险类型"""
        self.myindex.search()
        time.sleep(2)
        self.searchPage.insurance()
        # self.assertEqual()
